<?php
class ArticleForm extends Zend_Form
{
    public function __construct($options = null)
    {
        parent::__construct($options);
        $this->setName('article');

        $title = new Zend_Form_Element_Text('title');
        $title
            ->setLabel('Title')
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addValidator('NotEmpty')
            ;

        $content = new Zend_Form_Element_Textarea('content');
        $content
            ->setLabel('Content')
            ->setRequired(true)
            ->addValidator('NotEmpty')
            ;

        $author = new Zend_Form_Element_Select('author_id');
        $author
            ->setLabel('Author')
            ->setRequired(true)
            ->addValidator('NotEmpty')
            ;

        $category = new Zend_Form_Element_Select('category_id');
        $category
            ->setLabel('Category')
            ->setRequired(true)
            ->addValidator('NotEmpty')
            ;

        $submit = new Zend_Form_Element_Submit('submit');

        $this->addElements(
            array($title, $content, $author, $category, $submit)
        );
    }
}
?>